package org.nf.shopping.service.Impl;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.nf.shopping.entity.Order;
import org.nf.shopping.mapper.OrderMapper;
import org.nf.shopping.service.OrderService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author czl
 * @Date 2024-12-18
 */
@Service
@RequiredArgsConstructor
public class OrderServiceImpl implements OrderService {

    private final OrderMapper orderMapper;

    @Override
    public PageInfo<Order> listOrder(Integer pageSize, Integer pageNum, String id) {
        List<Order> list = orderMapper.listOrder(pageSize,pageNum,id);
        PageInfo<Order> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void updateOrder(Order order) {
        orderMapper.updateOrder(order);
    }

    @Override
    public void deloneOrder(Integer id) {
        orderMapper.deloneOrder(id);
    }

    @Override
    public void addOrder(Order order) {
        orderMapper.addOrder(order);
    }

    @Override
    public List<Order> getOrderList() {
        return orderMapper.getOrderList();
    }
}
